<!DOCTYPE >
<html>
	<head>
		<meta charset="utf-8">
		
		<title>自动化买卖定位</title>
		<script src="js/vue.min.js"></script>
		<style>
			.row{
			    border: 1px solid #ccc;
			    padding: 10px;
			}
			input{
				height:40px;
			}
		</style>
	</head>
	<body >
		<div id="cnt">
			    <div v-for="item in list" class="row">
					<div>{{item.name}}：</div>key:<input v-model:value="item.key">(x,y):<input v-model:value="item.xy">-延迟:<input v-model:value="item.delay">ms
				</div>
				<div id="info" style="opacity: 0;">{{info}}</div>
				<button @click="save">Save</button>
		</div>
	</body>
</html>
<script src="js/FileUtil.js"></script>
<script src="positionArr.js"></script>
<script>
	
let	app 

	app= new Vue({
		el: "#cnt",
		data: function() {
			return {
				list:[
					{name:"刷新",key:"refresh",xy:100,delay:100},
			    	{name:"点查询",key:"queryBtn",xy:100,delay:100},
					{name:"点输入框",key:"queryRect",xy:100,delay:100},
					{name:"点选股票",key:"getStock",xy:100,delay:100},
					{name:"点数量+",key:"addBtn",xy:100,delay:100},
					{name:"买入",key:"buyBtn",xy:100,delay:100},
					{name:"卖出",key:"sellBtn",xy:100,delay:100},
					{name:"确认",key:"confirm",xy:100,delay:100},
				
				],
				info:"",
			}
			},
			created(){
		    	let strArr=[];
			   positionArr.forEach(item=>{
				  strArr.push(item.key+","+item.xy+","+item.delay);
			   })
			   this.$data.info=strArr.join(";");
			   this.$data.list = positionArr;
			},
			methods:{
				save(){
				let data = "let positionArr="+JSON.stringify(this.$data.list);
				saveAs(data,"positionArr.js","text/plain;charset=utf-8");
				}
			}
			});
			
		
</script>
